<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2010 rel. 3 sp1 (http://www.altova.com) by Kalle Launiala (Citrus Solutions Oy) -->
<xs:schema xmlns="http://tempuri.org/ORMClass_v1_0.xsd" xmlns:mstns="http://tempuri.org/ORMClass_v1_0.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://tempuri.org/ORMClass_v1_0.xsd" elementFormDefault="qualified" id="ORMClass_v1_0">
	<xs:element name="ORMClassAbstraction">
		<xs:annotation>
			<xs:documentation>Comment describing your root element</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Classes" type="ClassesType" maxOccurs="unbounded">
					<xs:key name="PKClass">
						<xs:selector xpath="Class"/>
						<xs:field xpath="@name"/>
					</xs:key>
					<xs:keyref name="RefAssocToTargetClass" refer="PKClass">
						<xs:selector xpath="Class/Associations/Association"/>
						<xs:field xpath="@targetClass"/>
					</xs:keyref>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="AssociationType">
		<xs:attribute name="name" use="required">
			<xs:annotation>
				<xs:documentation>Must distinct duplicate target types, where default naming cannot solve the duplicate</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="targetClass" use="required">
			<xs:annotation>
				<xs:documentation>Must refer to existing key class name</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="relationship" use="required"/>
	</xs:complexType>
	<xs:complexType name="AssociationsType">
		<xs:sequence>
			<xs:element name="Association" type="AssociationType" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="ClassesType">
		<xs:sequence>
			<xs:element name="Class" type="ClassType" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="namespaceName" use="required"/>
	</xs:complexType>
	<xs:complexType name="ClassType">
		<xs:sequence>
			<xs:element name="Associations" type="AssociationsType" minOccurs="0">
				<!--
				<xs:key name="PKAssociationAssociations">
					<xs:selector xpath="r:Association"/>
					<xs:field xpath="@name"/>
					<xs:field xpath="@targetClass"/>
				</xs:key>
			-->
				<xs:key name="PKAssociation">
					<xs:selector xpath="Association"/>
					<xs:field xpath="@name"/>
				</xs:key>
			</xs:element>
			<xs:element name="Authorization" type="AuthorizationType" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="name" use="required">
			<xs:annotation>
				<xs:documentation>Unique name is required</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="AuthorizationType">
		<xs:attribute name="authorizedByClass" type="xs:string" use="required">
			<xs:annotation>
				<xs:documentation>Authorization master class type</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="auhtorizationPath" type="xs:string" use="required">
			<xs:annotation>
				<xs:documentation>Association path to the authorization master. Empty for self authorizing.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
</xs:schema>
